home *** CD-ROM | disk | FTP | other *** search
- //////////////////////////////////////////////////////
- // Source code for the "Payroll List" Class
- //
- //////////////////////////////////////////////////////
-
- #include "paylist.h"
-
- Boolean PayList::find(char *last)
- {
- if (Pfm_List::find("Last","==",(void *) last))
- {
- get(empBuffer);
- return(true);
- }
- return(false);
- }
-
- Boolean PayList::find(char *last, char *first)
- {
- if (DB_Find(table,"Last == %s && First == %s",
- last, first))
- {
- get(empBuffer);
- return(true);
- }
- return(false);
- }
-
- void PayList::add(employee &emp)
- {
- Pfm_List::add();
- replace(emp);
- }
-
- void PayList::replace(employee &emp)
- {
- Pfm_List::replace("First",emp.first);
- Pfm_List::replace("Last",emp.last);
- Pfm_List::replace("Pay",emp.pay_rate);
- Pfm_List::replace("Days",emp.days_worked);
- empBuffer = emp;
-
- }
-
- void PayList::get(employee &emp)
- {
- Pfm_List::get("First",emp.first);
- Pfm_List::get("Last",emp.last);
- Pfm_List::get("Pay",emp.pay_rate);
- Pfm_List::get("Days",emp.days_worked);
- }
-